<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>表单</title>
</head>

<body>
    <div id="app">
        <form id="form" action="/up" method="post" enctype="multipart/form-data" target="tage">
            <input type="text" name="name" value="Toma">
            <input type="password" name="pass" value="637311">
            <input type="file" name="file" ref="fileupload">
            <!-- <input type="submit" value="submit"> -->
        </form>
        <a href="javascript:" id="sub" @click="sub">点击上传</a> <br>
    </div>

    <iframe src="javascript:" name="tage" id="tag"></iframe>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/babel-polyfill/7.0.0-alpha.19/polyfill.min.js"></script>
    <script src="https://cdn.bootcss.com/vue/2.4.2/vue.min.js"></script>
    <script src="jquery.fileupload.js"></script>
    <script src="jquery.iframe-transport.js"></script>
    <script src="jquery.ui.widget.js"></script>
    <script>
        // $('#sub').on('click', function() {
        //     $('#form').submit();
        // })

        $(function() {

            $('#tag').on('load', function() {
                var ctx = $(this).contents()
                console.log(ctx.text())
            })

            new Vue({
                el: '#app',
                created: function() {

                },
                methods: {
                    sub: function() {
                        $('#form').submit();
                    }
                }
            })
        })
    </script>
</body>

</html>